home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C & C++ Multimedia Cyber Classroom
/
C and C++ Multimedia Cyber Classroom (Prentice Hall) (1998).iso
/
src
/
fig01_06.jar
/
Ch01
/
Fig01_06
/
Fig01_06.cpp
Wrap
C/C++ Source or Header
|
1997-10-05
|
527b
|
18 lines
// Fig. 1.6: fig1_06.cpp
// Addition program
#include <iostream.h>
int main()
{
int integer1, integer2, sum; // declaration
cout << "Enter first integer\n"; // prompt
cin >> integer1; // read an integer
cout << "Enter second integer\n"; // prompt
cin >> integer2; // read an integer
sum = integer1 + integer2; // assignment of sum
cout << "Sum is " << sum << endl; // print sum
return 0; // indicate that program ended successfully
}